package com.vitabuybuy.tv.dto;

import com.vitabuybuy.tv.utils.LanaugeUtils;

import java.io.Serializable;
import java.util.List;

/**
 * 作者：SimGa
 * 日期：2020/12/11
 * 时间：10:25
 * 包名：com.vitabuybuy.tv.dto
 */
public class AddressListDto implements Serializable {

    /**
     * zipcode : 515146
     * phone : 13247546172
     * regionList : [{"name":"中国","id":1},{"name":"广东","id":4},{"name":"广州","id":5}]
     * defaulted : true
     * name : zzt
     * id : 2
     * detail : 乐天大厦
     */

    private String zipcode;
    private String phone;
    private boolean defaulted;
    private String name;
    private int id;
    private String detail;
    private List<RegionListBean> regionList;
    private String addressDetail;

    public String getAddressDetail() {
        addressDetail = "";
        for(RegionListBean region : regionList){
            addressDetail = addressDetail + LanaugeUtils.returnStrByLocation(region.getName());
        }
        return addressDetail + detail;
    }

    public void setAddressDetail(String addressDetail) {
        this.addressDetail = addressDetail;
    }

    public String getZipcode() {
        return zipcode;
    }

    public void setZipcode(String zipcode) {
        this.zipcode = zipcode;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public boolean isDefaulted() {
        return defaulted;
    }

    public void setDefaulted(boolean defaulted) {
        this.defaulted = defaulted;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    public List<RegionListBean> getRegionList() {
        return regionList;
    }

    public void setRegionList(List<RegionListBean> regionList) {
        this.regionList = regionList;
    }

    public static class RegionListBean implements Serializable{
        /**
         * name : 中国
         * id : 1
         */

        private String name;
        private int id;

        public String getName() {
            return LanaugeUtils.returnStrByLocation(name);
        }

        public void setName(String name) {
            this.name = name;
        }

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }
    }
}
